/*
 * CLEAN X32 Configuration file. Contains only the core
 */
#include "peripherals/1to1.vh"
#include "peripherals/rs232.vh"
#include "peripherals/4x7seg.vh"
#include "peripherals/clock.vh"
#include "s3starter_pins.h"

#define TARGET xs3e400
#define CLOCKSPEED 50000000
#define CORE_SIZE_LONG 32
#define CORE_SIZE_INT 32
#define CORE_SIZE_SHORT 16
#define CORE_SIZE_POINTER 32
#define ROM_LOCATION 0x000C0000
#define ROM_ADDRESS_BITS 16

#define NORMAL_RESET button(0) = '1'

#define PERIPHERAL_ADDRESS_BITS 		8
#define PERIPHERAL_DATA_BITS 				32
#define PERIPHERAL_ID								1

#define INTERRUPTS_ENABLE
#define INTERRUPT_COUNT 16
#define INTERRUPT_ENABLE_INDEX 21

#define LIBCODE_X32_MS_CLOCK 0
#define LIBCODE_X32_US_CLOCK 0
/* LIBCODE_X32_STDOUT can't be set to 0, since putchar writes to 
		LIBCODE_X32_STDOUT. force it to peripherals[0], which should be connected
		to the readonly peripheral id, since the status always returns 0, putchar
		will never write to this peripheral */
#define LIBCODE_X32_STDOUT peripherals[0]
#define LIBCODE_X32_STDOUT_STATUS 0
#define LIBCODE_X32_STDIN 0
#define LIBCODE_X32_STDIN_STATUS 0

// need one device which generates the reset signal
ADD_1TO1_INPUT_DEVICE(button, 0x01, 0x00, 1, PIN_RESET)
